package org.kaindorf.kainflix.metadata.config;

import org.kaindorf.kainflix.metadata.repository.MetaDataRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import org.kaindorf.kainflix.metadata.repository.entity.Metadata;

@Component
@Profile("dev")
public class DemoConfigurer {

    @Autowired
    private MetaDataRepository metaDataRepository;

    @PostConstruct
    public void createDemoData() {
        {
            Metadata metaData;
            metaData = new Metadata(18000L, "language", "German");
            metaDataRepository.save(metaData);
        }
        {
            Metadata metaData;
            metaData = new Metadata(18000L, "format", "16:9");
            metaDataRepository.save(metaData);
        }
        {
            Metadata metaData;
            metaData = new Metadata(18001L, "language", "Dutch");
            metaDataRepository.save(metaData);
        }
        {
            Metadata metaData;
            metaData = new Metadata(18002L, "language", "German");
            metaDataRepository.save(metaData);
        }
        {
            Metadata metaData;
            metaData = new Metadata(18002L, "size", "big");
            metaDataRepository.save(metaData);
        }
        {
            Metadata metaData;
            metaData = new Metadata(18003L, "language", "German");
            metaDataRepository.save(metaData);
        }
        {
            Metadata metaData;
            metaData = new Metadata(18004L, "language", "German");
            metaDataRepository.save(metaData);
        }
    }

}
